package org.csmzxy.class2333;

public class Example04 {
    public static void main(String[] args) {
        String username1 = "heima12345!"; //定义字符串username1
        String username2 = "Heima12345!"; //定义字符串username2
        System.out.println("字符串" + username1 + "是否以heima开头: "
                + username1.startsWith("heima"));
        System.out.println("字符串" + username1 + "是否以!结尾: "
                + username1.endsWith("!"));
        System.out.println("字符串" + username1 + "是否为空: "
                + username1.isEmpty());
        System.out.println("字符串" + username1 + "是否包含字符串123: "
                + username1.contains("123"));
        System.out.println("字符串" + username1 + "," + username2 + "内容是否相同: "
                + username1.equals(username2));
        System.out.println("忽略大小写判断字符串" + username1 + "," + username2 +
                "内容是否相同: " + username1.equalsIgnoreCase(username2));
        System.out.println("按Unicode比较字符串" + username1 + "," + username2 +
                "的大小" + username1.compareTo(username2));
    }
}